import { generateUUID } from '@/utils'
import { ALL_COMPLETION_AVAILABLE_BLOCKS } from '../../constants'
import { LoopEndNodeType } from './types'
import { BlockEnum } from '@/components/workflow/types'

export const getLoopEndDefaultParams = () => {
  return {
    inputList: [
    ],
    outputList: [
    ],
  }
}

export default {
  getAvailablePrevNodes() {
    // 迭代器节点只能连接非End节点
    const nodes = ALL_COMPLETION_AVAILABLE_BLOCKS.filter(type => type !== BlockEnum.LoopEnd)
    return nodes
  },

  getAvailableNextNodes() {
    // 迭代器节点可以连接所有节点
    return ALL_COMPLETION_AVAILABLE_BLOCKS
  },

  // 检查节点是否有效
  checkValid: (payload: LoopEndNodeType) => {
    return true
  },

}